// Copyright 2013 Petar Maymounkov
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package fuserh

import (
	"io"

	"circuit/kit/fuse"
)

func (r *RH) init() interface{} {
	return &fuse.InitResponse{
		MaxWrite: 60e3, // 60K IP packet size  // uint32(syscall.Getpagesize()),
	}
}

func (r *RH) statfs() interface{} {
	return &fuse.StatfsResponse{
		Blocks:  0,    // Total data blocks in file system.
		Bfree:   0,    // Free blocks in file system.
		Bavail:  0,    // Free blocks in file system if you're not root.
		Files:   0,    // Total files in file system.
		Ffree:   0,    // Free files in file system.
		Bsize:   8192, // Block size
		Namelen: 4096, // Maximum file name length?
		Frsize:  0,    // ?
	}
}

func (r *RH) destroy() interface{} {
	r.ssn.SignOut()
	r.fuseEOF.Close(io.EOF)
	return nil
}
